﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace VS2010Test
{
	class ExpressionTrees
	{
		public void p()
		{
			ExpressionType eType = ExpressionType.Add;

			Expression arg1 = Expression.Constant(1);
			Expression arg2 = Expression.Constant(2);
			Expression add = Expression.Add(arg1, arg2);

			Func<int> compiled = Expression.Lambda<Func<int>>(add).Compile();
			int result = compiled.Invoke();

		}
	}
}
